package icu.yougan.trade.mapper;

import icu.yougan.trade.entity.IdleItem;
import icu.yougan.trade.entity.Order;
import icu.yougan.trade.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author:油柑
 * @changeByLyh
 * @Date:2024/5/18 22:30
 * @Version:v1.0.0
 * @Description:订单数据持久层
 **/
@Mapper
public interface OrderMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Long id);

    List<Order> getMyOrder(Long userId);

    List<Order> getAllOrder(int begin, int nums);

    int countAllOrder();

    List<Order> findOrderByIdleIdList(List<Long> idleIdList);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
    List<Order>getIdleToDaySales(int begin, int nums);
    List<Order>getIdleToLastDaySales(int begin, int nums);
    List<Date> getIdle7DaysDate();
    List<BigDecimal> getIdle7DaysSales();
    Order getOrderByNumber(String orderNumber);
    List<Order> selectByDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate);
    List<Order> selectExpiredOrders(@Param("currentTime") Date currentTime);
}
